
COBJS := $(patsubst %.c, %.o, $(wildcard *.c))
ASMOBJS := $(patsubst %.S, %.o, $(wildcard *.S))
#COBJS += version.o
EMPTY :=
SPACE := $(EMPTY) $(EMPTY)

include $(ROOTDIR)/Rules.mk

#.tmp.o:	$(COBJS) $(ASMOBJS)
#	$(LD) $(LDFLAGS) -o $@ $(MYOBJS)


# generate the version info
.PHONY: version.c
export DATE=$(shell date "+%F %T")
export HOST=$(shell hostname)
export DATE1=$(subst -,_,$(DATE))
export DATE2=$(subst :,_,$(DATE1))
export DATE3=$(subst $(SPACE),_,$(DATE2))
version.c: 
	@echo "#include \"cnix/verno.h\""  > $@
	@echo "const char version[] = { VERNO \" @$$HOST, $$DATE\" };" >> $@
	@echo "const char * version_time_$$DATE3 = \"version_time_$$DATE3\";" >> $@
	@echo "const char * version_time(void) { return version_time_$$DATE3; }" >> $@
